package com.ldw.demo.utils;

public class PageUtil {
    private int pageSize = 0;  //页面大小
    private int currentPage = 1;  //当前页面
    private int pageCount = 0;    //总条数
    private int sumPage = 0; //总页数

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(String pageIndex) {
        if(pageIndex == null) {
            return;
        }
        currentPage = Integer.parseInt(pageIndex);
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.setSumPage(pageCount);
        this.pageCount = pageCount;
    }

    public int getSumPage() {
        return sumPage;
    }

    public void setSumPage(int pageCount) {
        this.sumPage = pageCount / pageSize + 1;
    }
}
